package com.ys.controller.web.finance;

import com.ys.config.MenuId;
import com.ys.entity.finance.TcwWanliPaymentReturn;
import com.ys.entity.finance.TcwWanliPrepaymentPooling;
import com.ys.service.sys.CommonApiService;
import com.ys.vo.W;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

/**
 * @Author: fxz
 * @CreateTime: 2024-10-14
 * @Description: 预付款归集明细web
 * @Version: 1.0.0
 */
@Controller
@RequestMapping("/web/finance/tcwWanliPrepaymentPooling")
public class WebTcwWanliPrepaymentPooling {

    @Autowired
    private CommonApiService<TcwWanliPrepaymentPooling> commonApiService;

    /*
     * 编辑
     */
    @GetMapping("/toEdit")
    public String toEdit(Model model, HttpServletRequest request, HttpServletResponse response, @RequestParam Map<String, Object> params){
        if (params.get("id") == null){
            return W.error(model, "id不能为空");
        }
        Long id = Long.valueOf((params.get("id").toString()));

        try {
            return commonApiService.toEdit(model, id, new TcwWanliPrepaymentPooling(), MenuId.TCW_WanliPrepaymentPooling, null, null);
        } catch (Exception e) {
            e.printStackTrace();
            return "失败!";
        }
    }
}
